package com.otp.model.test.template;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.appfuse.model.User;
import com.otp.model.test.template.Attribute;
import com.otp.model.test.template.AttributeValue;

@Entity
@Table(name = "attribute_users")
public class AttributeUsers {
	
	private long objectId;
	private User user;
	private Attribute attribute;
	private AttributeValue attributeValue;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "object_id", unique = true, nullable = false)
	public Long getObjectId() {
		return objectId;
	}	
	public void setObjectId(Long objectId) {
		this.objectId = objectId;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "fk2app_user")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "fk2attribute")
	public Attribute getAttribute() {
		return attribute;
	}
	public void setAttribute(Attribute attribute) {
		this.attribute = attribute;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "fk2attribute_value")
	public AttributeValue getAttributeValue() {
		return this.attributeValue;
	}

	public void setAttributeValue(AttributeValue attributeValue) {
		this.attributeValue = attributeValue;
	}


}
